package com.interest.controller;

import com.interest.controller.builder.ListModelAndViewBuilder;
import com.interest.modules.packagebranch.entity.PackageBranch;
import com.interest.modules.packagebranch.service.PackageBranchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping("/package/branch")
public class PackageBranchController {

    @Autowired
    private PackageBranchService packageBranchService;

    @RequestMapping("/list")
    public ModelAndView getList() {
        List<PackageBranch> list = packageBranchService.getList();
        return new ListModelAndViewBuilder("package/branch", list).build();
    }
}
